﻿#pragma once
#include "afxdialogex.h"
#include <string>
#include <vector>
#include <thread>

struct UserInfo {
public:
	std::string nickname_;
	std::string school_;
	int userid_;
	std::vector<std::string> history_msg_;
	int msg_cnt_;
}; 


// ChatWin 对话框

class ChatWin : public CDialogEx
{
	DECLARE_DYNAMIC(ChatWin)

public:
	ChatWin(int userid, CWnd* pParent = nullptr);   // 标准构造函数
	virtual ~ChatWin();
	void RefreshUserList();
// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_CHATWIN };
#endif

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()
public:
	//afx_msg void OnBnClickedButton2();
	afx_msg void OnBnClickedButsendmsg();
	virtual BOOL OnInitDialog();
private:
	
	
	
public:
	int uid_;
	CListBox friend_list;
	std::vector<struct UserInfo> vec_fri_;
	afx_msg void OnLbnSelchangeListfriendinfo();
	CListBox msg_list_;
	afx_msg void OnLbnSelchangeListmsginfo();
	// 用户输入聊天框的内容
	CString user_input_;
	CEdit user_input_edit_;
	int suid_;
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnBnClickedAddfriend();
};
